[Unit]
Description=Manages Virtual IP for Patroni
After=network-online.target
Before=patroni.service

[Service]
Type=simple

ExecStart=/usr/bin/vip-manager --config={{ vip_manager_conf }}

# VIP not released when service stopped https://github.com/cybertec-postgresql/vip-manager/issues/19
ExecStopPost=/sbin/ip addr del {{ vip_manager_ip }}/{{ vip_manager_mask }} dev {{ vip_manager_iface }}

Restart=on-failure

[Install]
WantedBy=multi-user.target
